@extends('public.public')

@section('main')
    @include('public.info')
    <div>
        <form class="navbar-form" method="post" action="{{url('test/test')}}">
            {{csrf_field()}}
            <div class="form-group">
                <input type="text" name="id" class="form-control" placeholder="id">
            </div>
            <button type="submit" class="btn btn-default">Submit</button>
        </form>
    </div>
    <div class="panel panel-default">
        <!-- Default panel contents -->
        <div class="panel-heading">学生信息表</div>
        <!-- Table -->
        <table class="table table-bordered">
            <tr>
                <td>编号</td>
                <td>姓名</td>
                <td>性别</td>
                <td>年龄</td>
                <td>班级</td>
                <td>操作</td>
            </tr>
            @foreach($res as $v)
                <tr>
                    <td>{{$v->id}}</td>
                    <td>{{$v->name}}</td>
                    <td>{{$v->sex}}</td>
                    <td>{{$v->age}}</td>
                    <td>{{$v->cla}}</td>
                    <td>
                        <a href="{{url('test/delete?id='.$v->id)}}" onclick="if(confirm('确定要删除吗？')===false) return false">删除</a>
                        <a href="{{url('test/update?id='.$v->id)}}">修改</a>
                        <a href="{{url('test/detail?id='.$v->id)}}">详情</a>
                    </td>
                </tr>
            @endforeach

        </table>
    </div>
    <div class="text-right">
        {{$res->render()}}
    </div>
    @stop